import logging


def getlog(info):
    logger = logging.getLogger()
    hdlr = logging.FileHandler(info['logFile'])
    formatter = logging.Formatter('%(asctime)s %(levelname)s %(message)s')
    hdlr.setFormatter(formatter)
    logger.addHandler(hdlr)
    try:
        logger.setLevel(info['logLevel'])
    except:
        print("log level error.")

    return logger